<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="fragments/head::head"/>
<link rel="stylesheet" th:href="@{/assets/css/colorbox.css}"/>
<link rel="stylesheet" th:href="@{/assets/css/fixedColumns.dataTables.css}"/>
<link rel="stylesheet" th:href="@{/assets/css/jquery.dataTables.min.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/assets/css/chosen.css}"/>
<style>
    .error {
        color: #F00
    }

    #sample-table-2 .dataTables_wrapper {
        position: relative;
        clear: both;
        zoom: 1;
        overflow-x: auto;
    }

    #sample-table-2 table {
        width: 800px;
    }

</style>
<body>
<div th:include="fragments/top::top"></div>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div th:include="fragments/left::left" class="sidebar" id="sidebar"></div>
        <div class="main-content">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <input type="hidden" id="input_role" th:value=" ${role != null?role:''}"/>
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">待回访学生信息列表</h3>
                                <div class="table-header">
                                    <form class="form-inline">
                                        <shiro:hasPermission name="visit:list">
                                            <input type="hidden" id="input_hasPermission_visit_list" value="1"/>
                                        </shiro:hasPermission>
                                        <div class="form-group">
                                            <label for="sNo">学号：</label>
                                            <input type="text" id="sNo" class="form-control input-sm"
                                                   th:value="${#httpServletRequest.getParameter('studentNo')}"
                                                   placeholder="" style="width:100px;"/>
                                            <label for="sName">姓名：</label>
                                            <input type="text" id="sName" class="form-control input-sm" placeholder=""
                                                   style="width:100px;"/>
                                            <label for="sName">顾问名称：</label>
                                            <input type="text" id="teacherName" class="form-control input-sm" placeholder=""
                                                   style="width:100px;"/>

                                            <label for="startTime"> 开始日期：</label>
                                            <input class="form-control input-sm" placeholder="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                                   id="startTime" name="startTime" style="width:100px;" />
                                            <label for="endTime"> 结束日期：</label>
                                            <input class="form-control input-sm" placeholder="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"
                                                   id="endTime" name="endTime" style="width:100px;"/>
                                        </div>
                                        <button type="button" id="query" class="btn btn-success ">查询</button>
                                        <button id="empty" type="reset" class="btn btn-warning">清空</button>
                                        <a href="/student/excelVisitInfo" class="btn btn-success pull-right">导出</a>
                                    </form>
                                </div>
                                <div class="table-responsive">
                                    <div id="alert" class="alert alert-success" style="display: none;" role="alert">
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                        <span id="alertText"></span>
                                    </div>

                                    <table id="sample-table-2" class="table table-striped table-bordered table-hover "
                                           >
                                        <thead>
                                        <tr>
                                            <th>学号</th>
                                            <th>姓名</th>
                                            <th>拼音</th>
                                            <th>出生日期</th>
                                            <th>合同名称</th>
                                            <th>咨询顾问</th>
                                            <th>文签顾问</th>
                                            <th>制作文案</th>
                                            <th>文书员</th>
                                            <th>文案员</th>
                                            <th>业务员</th>
                                            <th>分支机构</th>
                                            <th>签约日期</th>
                                            <th>学生当前服务进程</th>
                                            <th>最新一次回访日期</th>
                                            <th>回访</th>
                                        </tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div th:include="fragments/bottom::bottom"></div>
    </div>

    <a href="#" id="btn-scroll-up"
       class="btn-scroll-up btn btn-sm btn-inverse"> <i
            class="icon-double-angle-up icon-only bigger-110"></i>
    </a>
</div>

<!-- Modal备注 -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content"></div>
    </div>
</div>
<div th:include="fragments/js::js"></div>
<script charset="UTF-8" th:src="@{/assets/js/jquery.validate.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/jquery.validate.zh-CN.js}"></script>
<!-- page specific plugin scripts -->
<script charset="UTF-8" th:src="@{/assets/js/jquery.dataTables.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/jquery.dataTables.bootstrap.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/dataTables.fixedColumns.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/temp.js}"></script>
<script charset="UTF-8" th:src="@{/business/student/studentList.js}"></script>
<!--图片查看器-->
<script charset="UTF-8" th:src="@{/assets/js/jquery.colorbox-min.js}"></script>
<script charset="UTF-8" th:src="@{/layer/layer.js}"></script>
<script charset="UTF-8" th:src="@{/My97DatePicker/WdatePicker.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/chosen.jquery.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/date-time/bootstrap-datepicker.min.js}"></script>
<script charset="UTF-8" th:src="@{/assets/js/date-time/bootstrap-timepicker.min.js}"></script>
<script th:src="@{/assets/js/date-time/moment.min.js}"></script>
<script type="text/javascript">
    <!--
    jQuery(function($) {
        var pageHelper = (function(){
            this.oTable1;
            /*this.getTimeString_day = function (date) {
                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                m = m >= 10 ? m : '0' + m;
                var d = date.getDate();
                d = d >= 10 ? d : '0' + d;
                return y + '-' + m + '-' + d;
            }*/
            return{
                init:function(){
                    this.getQueryData();
                    this.handelQueryData();
                    this.render();
                    this.addEvent();
                },
                getQueryData:function(){

                },
                handelQueryData:function(){

                },
                render:function(){
                    var _self = this;
                    _self.oTable1 =  $('#sample-table-2').dataTable({
                        "aLengthMenu": [10,20],  //用户可自选每页展示数量 5条或10条
                        // "sScrollY": "450px",
                        "scrollX": true,//控制在列过多过宽是,是否出现水平滚动条
                        "scrollCollapse": true,
                        "bProcessing": true,//显示搜索样式
                        "bDeferRender": true,//延迟加载表格
                        "fixedColumns": { //固定列的配置项
                            "leftColumns": 3, //固定左边第一列
                        },
                        "bFilter": false,//是否使用搜索
                        "sPaginationType": "bs_normal",//分页样式
                        "bRetrieve": true,//是否调用后台
                        "bServerSide": true,//是否以后台分页
                        "bAutoWidth": true,
                        "sAjaxSource": "/student/toDoVisitList/query",//请求路径
                        "fnServerData": function (sSource, aoData, fnCallback) {
                            aoData.push(
                                {name: 'studentNo', value: $("#sNo").val() == "" ? null : $.trim($("#sNo").val())},
                                {name: 'studentName', value: $("#sName").val() == "" ? null : $.trim($("#sName").val())},
                                {name: 'copyOperator',value:$("#teacherName").val() == "" ? null:$.trim($("#teacherName").val())},
                                {name: 'startTime',value:$("#startTime").val() == "" ? null:$.trim($("#startTime").val())},
                                {name: 'endTime',value:$("#endTime").val() == "" ? null:$.trim($("#endTime").val())},
                                {name: 'roleName',value:$("#input_role").val() == "" ? null:$.trim($("#input_role").val())}
                            )
                            $.ajax({
                                "dataType": 'json',
                                "type": "GET",
                                "url": sSource,
                                "data": aoData,
                                "success": fnCallback
                            });
                        },
                        "aaSorting": [[0, "desc"]],
                        "bSort": true,
                        "aoColumns": [
                            {"sClass": "center", "bSortable": false, "mData": function(data){
                                    return "<a href='/visit?studentNo="+data.studentNo+"&visitCase=1'>"+data.studentNo+"</a>"
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "studentName"},
                            {"sClass": "center", "bSortable": false, "mData": "pinyin"},
                            {"sClass": "center", "bSortable": false, "mData": "birthday",
                                "mRender" : function(data, type, full, meta) {
                                    if(data != null) {
                                        return moment(data).format("YYYY-MM-DD");
                                    }
                                    else{
                                        return "";
                                    }
                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "contractNo"},
                            {"sClass": "center", "bSortable": false, "mData": "salesConsultant"},
                            {"sClass": "center", "bSortable": false, "mData": "copyOperator"},
                            {"sClass": "center", "bSortable": false, "mData": "copyMaker"},
                            {"sClass": "center", "bSortable": false, "mData": "copier"},
                            {"sClass": "center", "bSortable": false, "mData": "copy"},
                            {"sClass": "center", "bSortable": false, "mData": "visaOperator"},
                            {"sClass": "center", "bSortable": false, "mData": "branchName"},
                            {"sClass": "center", "bSortable": false, "mData": "signDate" },
                            {"sClass": "center", "bSortable": false, "mData":
                                function (data) {
                                    if (data.status == 10) {
                                        return "未上传文书材料";
                                    } else if (data.status == 20) {
                                        return "未递交申请材料";
                                    } else if (data.status == 30) {
                                        return "未收到申请结果";
                                    } else if (data.status == 40) {
                                        return "未确认录取院校";
                                    } else if (data.status == 50) {
                                        return "未进行签证辅导";
                                    } else if (data.status == 60) {
                                        return "未递交签证申请";
                                    } else if (data.status == 70) {
                                        return "未收到签证结果";
                                    } else if (data.status == 80) {
                                        return "未填写获签信息";
                                    }else if (data.status == 85) {
                                        return "未结案";
                                    }else if (data.status == 90) {
                                        return "已结案";
                                    } else if (data.status == 100) {
                                        return "已退费";
                                    }  else {
                                        return "";
                                    }

                                }
                            },
                            {"sClass": "center", "bSortable": false, "mData": "lastVisitTime",
                                "mRender" : function(data, type, full, meta) {
                                    if(data != null) {
                                        return moment(data).format("YYYY-MM-DD");
                                    }
                                    else {
                                        return "";
                                    }
                                }
                            },
                            {
                                "sClass": "center", "bSortable": false, "mData": function (data) {
                                    var styleDiv = '<div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">';
                                    var visitOperation = '';
                                    if ($("#input_hasPermission_visit_list").val() == "1") {
                                        visitOperation = '<a class="blue"  href="javascript:void(0);" onclick="toVisitURL(\'' + data.studentNo + '\')"><i class="icon-pencil bigger-130"></i></a>';
                                    }
                                    return styleDiv + visitOperation + '</div>';
                                }
                            }

                        ],
                        "oLanguage": {
                            "sLengthMenu": "每页 _MENU_条 ",
                            "sZeroRecords": "对不起，查询不到任何相关数据",
                            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                            "sInfoEmpty": "显示 0 到 0 条，共 0 条记录",
                            "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                            "sProcessing": "正在加载中...",
                            "sSearch": "搜索",
                            "sUrl": "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                            "oPaginate": {
                                "sFirst": "第一页",
                                "sPrevious": " 上一页 ",
                                "sNext": " 下一页 ",
                                "sLast": " 最后一页 "
                            }
                        }
                    });
                    $("#sStatus").val($("#status").val());
                    $(".chosen-select").chosen();
                },
                addEvent:function(){
                    var _self = this;
                    $("#query").click(function () {
                        _self.oTable1.fnDraw();
                    });
                    $(document).keyup(function (e) {
                        if (e.keyCode == 13) {
                            $("#query").click();
                        }
                    });
                    $("#empty").click(function () {
                        window.location.reload();
                    })
                }
            }
        }());
        pageHelper.init();
    });
    -->
</script>
</body>
</html>
